<template>
  <div class="app-container">
    <div class="head">
      <img src="@/assets/img/Layout/position.png" />
      <p class="see-block">详情</p>
    </div>
    <div class="view-container">
      <el-row class="status-title">
        <el-col>
            <el-button
                class="btn-default width100"
                type="primary"
                @click="onReturn()"
            >返回</el-button>
        </el-col>
    </el-row>
      <el-row class="detail-item">
        <el-col :span="8">
            <span>产品名称：</span>{{ detailData.name ? detailData.name : '暂无' }}
        </el-col>
      </el-row>
      <el-row class="detail-item">
        <el-col :span="24">
            <span>产品内容：</span>
            <div v-html="detailData.content"></div>
        </el-col>
      </el-row>
    </div>
  </div>
</template>

<script>
import { proSampleDetail } from "@/api/system/proSample/proSample"
export default {
  name: "add",
  data(){
    return {
      id: '',
      detailData: '',
    }
  },
  created() {
    this.id = this.$route.query.id
    this.getDetailData()
  },
  methods: {
    // 获取详细信息
    getDetailData() {
      proSampleDetail(this.id).then(res => {
            if(res.code == 200){
                this.detailData = res.data
            }
        })
    },
    // 返回
    onReturn(){
      this.$tab.closeOpenPage({ path: "/proSample/list" })
    }
  }
}
</script>